package com.maixin.code.service;

import java.util.List;

import com.maixin.code.dao.DAO;
import com.maixin.code.dao.DataDictionaryDAO;
import com.maixin.code.entity.DataDictionary;
/**
 * 数据字典Service
 * @author SJ
 *
 */
public class DataDictionaryService {
	
	private DataDictionaryDAO dataDictionaryDAO;
	
	private DAO<DataDictionary> baseDao;
	
	
	public DataDictionary save(DataDictionary t){
		try {
			return baseDao.save(t);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
	
	public List<DataDictionary> findPerantDict(){
		return dataDictionaryDAO.findPerantDict();
	}
	
//	public List<DataDictionary> findAll(Integer start,Integer limit){
//		try {
//			return baseDao.findAll(new DataDictionary(), start, limit);
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//		return null;
//	}
	
//	/**
//	 *  根据条件查询数据
//	 * @param propertyNames
//	 * @param values
//	 * @return
//	 */
//	public List<Userinfo> findByProperties(String[] propertyNames, Object[] values){
//		return userinfoDAO.findByProperties(propertyNames, values);
//	}
	
//	public List<Userinfo> findAllByPage(PageUtils pageUtils){
//		if(null == pageUtils){
//			pageUtils = new PageUtils();
//			pageUtils.setNextPage(1);
//		}
//		return dataDictionaryDAO.findAllByPage(pageUtils);
//	}
//	public List<DataDictionary> findAllDataDic(Integer start,Integer limit){
//		return baseDao.findAll(DataDictionary.class, start, limit);
//	}
	
//	public void addDataDic(DATADictionary1 d){
//		 dataDictionaryDAO.save(d);
//	}

	public DataDictionaryDAO getDataDictionaryDAO() {
		return dataDictionaryDAO;
	}


	public void setDataDictionaryDAO(DataDictionaryDAO dataDictionaryDAO) {
		this.dataDictionaryDAO = dataDictionaryDAO;
	}

	public DAO<DataDictionary> getBaseDao() {
		return baseDao;
	}

	public void setBaseDao(DAO<DataDictionary> baseDao) {
		this.baseDao = baseDao;
	}


	
	
	
	

}
